public class 移除元素 {
    public static void main(String[] args) {
        


    }

    public int removeElement(int[] nums, int val) {

        int position = 0;
        for(int v : nums) {

            if(v != val){
                nums[position] = v;
                position++;
            }

        }

        return position;

    }
}
